package chixing.day07.homwork;

public class SalesEmployee extends MyEmployee{
    public double salesAmount;//销售额
    public double commissionRate;//佣金率

    public SalesEmployee(){}
    public SalesEmployee(double salesAmount, double commissionRate) {
        this.salesAmount = salesAmount;
        this.commissionRate = commissionRate;
    }

    public SalesEmployee(int empNo, String empName, double empBalanceSalary, double salesAmount, double commissionRate) {
        super(empNo, empName, empBalanceSalary);
        this.salesAmount = salesAmount;
        this.commissionRate = commissionRate;
    }

    public double calculateSalary(){
        return this.getEmpBalanceSalary() + salesAmount *  commissionRate;
    }
    public double getSalesAmount() {
        return salesAmount;
    }

    public void setSalesAmount(double salesAmount) {
        this.salesAmount = salesAmount;
    }

    public double getCommissionRate() {
        return commissionRate;
    }

    public void setCommissionRate(double commissionRate) {
        this.commissionRate = commissionRate;
    }

    @Override
    public String toString() {
        return "SalesEmployee{" +
                "salesAmount=" + salesAmount +
                ", commissionRate=" + commissionRate +
                '}';
    }
}
